home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / network / file-tra / fsp-2.7 / fsp-2 / fsp / include / vms / time.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-04-14  |  2.0 KB  |  86 lines

  1. /*    @(#)time.h 2.9 87/01/17 SMI; from UCB 7.1 6/4/86    */
  2.  
  3. /*
  4.     Definitions of various structures used on UNIX for
  5.     time-related syscalls.
  6. */
  7.  
  8. /*
  9.  * Copyright (c) 1982, 1986 Regents of the University of California.
  10.  * All rights reserved.  The Berkeley software License Agreement
  11.  * specifies the terms and conditions for redistribution.
  12.  */
  13.  
  14. #ifndef _UNIX_TIME_
  15. #define _UNIX_TIME_
  16.  
  17. /*
  18.  * Structure returned by gettimeofday(2) system call,
  19.  * and used in other calls.
  20.  *
  21.  * William P. Bame (2/8/91)
  22.  * since "timeval" is defined in socket.h (for VMS), don't define it here.
  23.  */
  24.  
  25. #ifndef __SOCKET_LOADED
  26. #include <socket.h>
  27. #endif
  28.  
  29. #ifndef __SOCKET_TYPEDEFS
  30. struct timeval
  31. {
  32.     long    tv_sec;        /* seconds */
  33.     long    tv_usec;    /* and microseconds */
  34. };
  35. #endif
  36.  
  37. struct timezone
  38. {
  39.     int    tz_minuteswest;    /* minutes west of Greenwich */
  40.     int    tz_dsttime;    /* type of dst correction */
  41. };
  42.  
  43. #define    DST_NONE    0    /* not on dst */
  44. #define    DST_USA        1    /* USA style dst */
  45. #define    DST_AUST    2    /* Australian style dst */
  46. #define    DST_WET        3    /* Western European dst */
  47. #define    DST_MET        4    /* Middle European dst */
  48. #define    DST_EET        5    /* Eastern European dst */
  49. #define    DST_CAN        6    /* Canada */
  50. #define    DST_GB        7    /* Great Britain and Eire */
  51. #define    DST_RUM        8    /* Rumania */
  52. #define    DST_TUR        9    /* Turkey */
  53. #define    DST_AUSTALT    10    /* Australian style with shift in 1986 */
  54.  
  55. /*
  56.  * Operations on timevals.
  57.  *
  58.  * NB: timercmp does not work for >= or <=.
  59.  */
  60. #define    timerisset(tvp)        ((tvp)->tv_sec || (tvp)->tv_usec)
  61. #define    timercmp(tvp, uvp, cmp)    \
  62.     ((tvp)->tv_sec cmp (uvp)->tv_sec || \
  63.      (tvp)->tv_sec == (uvp)->tv_sec && (tvp)->tv_usec cmp (uvp)->tv_usec)
  64. #define    timerclear(tvp)        (tvp)->tv_sec = (tvp)->tv_usec = 0
  65.  
  66. /*
  67.  * Names of the interval timers, and structure
  68.  * defining a timer setting.
  69.  */
  70. #define    ITIMER_REAL    0
  71. #define    ITIMER_VIRTUAL    1
  72. #define    ITIMER_PROF    2
  73.  
  74. struct    itimerval
  75. {
  76.     struct    timeval it_interval;    /* timer interval */
  77.     struct    timeval it_value;    /* current value */
  78. };
  79.  
  80. #ifndef __TIME_LOADED
  81. #include <time.h>
  82. #endif
  83.  
  84. #endif !_UNIX_TIME_
  85.  
  86.